package source.s02.synchronizedMethodLockObject.test.run;


import source.s02.synchronizedMethodLockObject.extobject.MyObject;
import source.s02.synchronizedMethodLockObject.extthread.ThreadA;
import source.s02.synchronizedMethodLockObject.extthread.ThreadB;

public class Run {

	//synchronized 申明的方法排队运行;共享的资源才需要同步
	public static void main(String[] args) {
		MyObject object = new MyObject();
		ThreadA a = new ThreadA(object);
		a.setName("A");
		ThreadB b = new ThreadB(object);
		b.setName("B");

		a.start();
		b.start();
	}

}
